package test;

public abstract class Document {
	
	public static final int TYPE_PLAINTEXT = 0;
	public static final int TYPE_RICHTEXT = 1;
	
	public static Document createDocument(int docType) {
		switch (docType) {
		case TYPE_PLAINTEXT:
			return new PlainTextDocument(docType);
		case TYPE_RICHTEXT:
			return new RichTextDocument(docType);
		default:
			throw new IllegalArgumentException("Illegal Document");
		}
	}

	protected int docType;

	public Document(int docType){
		this.setDocType(docType);
	}
	
	public abstract void copy();

	public void setDocType(int docType) {
		this.docType = docType;
	}

	public abstract int getDocType();
}
